package cn.mafangui.hotel.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

/**
 * @author: kalpa
 * @date: 2022/3/13
 * @version: 1.0
 * Description: No Description
 */
@Configuration
public class SwaggerConfig {
    @Bean
    public Docket createRestApi() {
        // 与v2不同
        return new Docket(DocumentationType.OAS_30)
                .select()
                //  设置扫描路径
                .apis(RequestHandlerSelectors.basePackage("cn.mafangui.hotel.controller"))
                .build();
    }
}
